package yl.hs.bmipfull.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 作用:   <br/>
 * 创建时间: 2022-08-02 09:18 <br/>
 *
 * @author 吴高丰
 */

@Configuration
public class FileUitile extends WebMvcConfigurerAdapter {
    @Value("${photos.requert}")
    private String url;

    @Value("${files.requert}")
    private String filesUrl;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

        registry.addResourceHandler("/photos/**").addResourceLocations("file:"+url);
        registry.addResourceHandler("/files/**").addResourceLocations("file:"+filesUrl);
    }
}
